#ifndef YSYXSOC_H__
#define YSYXSOC_H__

#include <klib-macros.h>
#define RTC_ADDR            0x02000000
#define MROM_ADDR           0x20000000
#define SRAM_ADDR           0x0f000000
#define FLASH_ADDR          0x30000000
#define PSRAM_ADDR          0x80000000
#define SDRAM_ADDR          0xa0000000
#define SDRAM_SIZE          0x08000000
#define PSRAM_SIZE          0x00400000
#define SDRAM_END           0xbfffffff
#define UART_BASE           0x10000000L
// UART Registers are 8-bit
#define UART_TX             UART_BASE+0
#define UART_LCR            UART_BASE+3
#define UART_LSR            UART_BASE+5
#define UART_DIVH           UART_BASE+1
#define UART_DIVL           UART_BASE+0

#define SPI_BASE            0x10001000L
// SPI Registers are 32-bit
#define SPI_END             SPI_BASE + 0x00000fff
#define SPI_RX0             SPI_BASE + 0x00
#define SPI_RX1             SPI_BASE + 0x04
#define SPI_RX2             SPI_BASE + 0x08
#define SPI_RX3             SPI_BASE + 0x0c
#define SPI_TX0             SPI_BASE + 0x00
#define SPI_TX1             SPI_BASE + 0x04
#define SPI_TX2             SPI_BASE + 0x08
#define SPI_TX3             SPI_BASE + 0x0c
#define SPI_CTRL            SPI_BASE + 0x10
#define SPI_DIV             SPI_BASE + 0x14
#define SPI_SS              SPI_BASE + 0x18

// GPIO Registers
#define GPIO_BASE 0x10002000
#define GPIO_LED GPIO_BASE + 0x0
#define GPIO_SW GPIO_BASE + 0x4
#define GPIO_SEG GPIO_BASE + 0x8
#endif
